package ch.bluepenguin.sling.rest.client.tests

import ch.bluepenguin.sling.rest.RestClient

/**
 * Created by IntelliJ IDEA.
 * User: christian
 * Date: Aug 3, 2008
 * Time: 7:29:35 PM
 * To change this template use File | Settings | File Templates.
 */
class SlingClientTests extends GroovyTestCase{
    void testSimple() {
         def client = new RestClient("http://localhost:8080", "admin", "admin")
        println client.get("/index.html")
        assert(client.get("/index.html").startsWith("<html>"))
        File file = new File("/tmp/test.txt").withPrintWriter { w ->
            w.println "This is an example of the usePrintWriter"
            w.println "available in the standard Groovy package."
        }
        client.putFile("/tmp/test.txt", "/content/files2", ["name": "./*"])
        println client.get("/content/files2/test.txt")
//                client.putFile("/tmp/test.txt", "/content/files2/", null)

    }
}